org.eclipse.vtp.framework.engine.support
Class AbstractProcessContext

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.support.AbstractReporter
      extended by org.eclipse.vtp.framework.engine.support.AbstractLogger
          extended by org.eclipse.vtp.framework.engine.support.AbstractContext
              extended by org.eclipse.vtp.framework.engine.support.AbstractProcessContext
All Implemented Interfaces:
IContext, ILogger, IProcessContext, IReporter
Direct Known Subclasses:
Process.Context

public abstract class AbstractProcessContext
extends AbstractContext
implements IProcessContext

A support implementation of the IProcessContext interface.

Author:
Lonnie Pryor

Field Summary
protected  IProcessDescriptor descriptor
          The process descriptor.
protected  java.util.Set providedServiceIdentifiers
          The service identifiers provided by the descriptor.
protected static java.util.Set RESERVED_SERVICE_IDENTIFIERS
          The service identifiers that will return this context.
 
Fields inherited from interface org.eclipse.vtp.framework.core.IReporter
SEVERITY_DEBUG, SEVERITY_ERROR, SEVERITY_INFO, SEVERITY_WARN
 
Constructor Summary
protected AbstractProcessContext(IProcessDescriptor descriptor)
          Creates a new AbstractProcessContext.
 
Method Summary
protected  void doReport(int severity, java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Implementation of report creation and publication after checking the severity.
 java.lang.String getProcessID()
          Returns the ID of this process.
 java.lang.Object getProperty(java.lang.String propertyName)
          Returns the value of the process-level configuration property with the specified name or null if no such property exists.
 boolean isSeverityEnabled(int severity)
          Returns true if the specified severity level is enabled.
 java.lang.Class loadClass(java.lang.String className)
          Loads a class visible to the process.
protected  java.lang.Object[] lookupAllLocalServices(java.lang.String identifier)
          Returns all the services registered under the specified identifier in this registry or null if no such services can be found.
protected  java.lang.Object lookupLocalService(java.lang.String identifier)
          Returns a service registered under the specified identifier in this registry or null if no such service exists.
protected  java.lang.Object lookupReservedService(java.lang.String identifier)
          Returns the reserved service if the specified identifier is one of the reserved identifiers or null if these conditions are not met.
 
Methods inherited from class org.eclipse.vtp.framework.engine.support.AbstractContext
lookup, lookupAll, lookupAllInheritedServices, lookupInheritedService
 
Methods inherited from class org.eclipse.vtp.framework.engine.support.AbstractLogger
debug, debug, debug, debug, doLog, error, error, error, error, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isWarnEnabled, log, log, log, log, warn, warn, warn, warn
 
Methods inherited from class org.eclipse.vtp.framework.engine.support.AbstractReporter
report, report, report, report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.framework.core.IContext
lookup, lookupAll
 
Methods inherited from interface org.eclipse.vtp.framework.core.ILogger
debug, debug, debug, debug, error, error, error, error, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isWarnEnabled, log, log, log, log, warn, warn, warn, warn
 
Methods inherited from interface org.eclipse.vtp.framework.core.IReporter
report, report, report, report
 

Field Detail

RESERVED_SERVICE_IDENTIFIERS

protected static final java.util.Set RESERVED_SERVICE_IDENTIFIERS
The service identifiers that will return this context.


descriptor

protected final IProcessDescriptor descriptor
The process descriptor.


providedServiceIdentifiers

protected final java.util.Set providedServiceIdentifiers
The service identifiers provided by the descriptor.

Constructor Detail

AbstractProcessContext

protected AbstractProcessContext(IProcessDescriptor descriptor)
                          throws java.lang.NullPointerException
Creates a new AbstractProcessContext.

Parameters:
descriptor - The process descriptor.
Throws:
java.lang.NullPointerException - If the supplied descriptor is null.
Method Detail

doReport

protected void doReport(int severity,
                        java.lang.String[] categories,
                        java.lang.String message,
                        java.util.Dictionary properties)
Description copied from class: AbstractReporter
Implementation of report creation and publication after checking the severity.

Specified by:
doReport in class AbstractReporter
Parameters:
severity - The severity of the report.
categories - The categories the report pertains to or null if no catagories are related.
message - The message associated with the report or null to not include a message.
properties - The properties of the report or null if no properties are specified.

isSeverityEnabled

public boolean isSeverityEnabled(int severity)
Description copied from interface: IReporter
Returns true if the specified severity level is enabled.

Specified by:
isSeverityEnabled in interface IReporter
Parameters:
severity - The severity to check.
Returns:
True if the specified severity level is enabled.

lookupReservedService

protected java.lang.Object lookupReservedService(java.lang.String identifier)
Description copied from class: AbstractContext
Returns the reserved service if the specified identifier is one of the reserved identifiers or null if these conditions are not met.

Overrides:
lookupReservedService in class AbstractContext
Parameters:
identifier - The identifier of the service to return, will never be null.
Returns:
The reserved service if the specified identifier is one of the reserved identifiers or null if these conditions are not met.

lookupLocalService

protected java.lang.Object lookupLocalService(java.lang.String identifier)
Description copied from class: AbstractContext
Returns a service registered under the specified identifier in this registry or null if no such service exists.

Overrides:
lookupLocalService in class AbstractContext
Parameters:
identifier - The identifier of the service to return, will never be null.
Returns:
A service registered under the specified identifier in this registry or null if no such service exists.

lookupAllLocalServices

protected java.lang.Object[] lookupAllLocalServices(java.lang.String identifier)
Description copied from class: AbstractContext
Returns all the services registered under the specified identifier in this registry or null if no such services can be found.

Overrides:
lookupAllLocalServices in class AbstractContext
Parameters:
identifier - The identifier of the services to return, will never be null.
Returns:
All the services registered under the specified identifier in this registry or null if no such services can be found.

getProcessID

public final java.lang.String getProcessID()
Description copied from interface: IProcessContext
Returns the ID of this process.

Specified by:
getProcessID in interface IProcessContext
Returns:
The ID of this process.

getProperty

public final java.lang.Object getProperty(java.lang.String propertyName)
                                   throws java.lang.NullPointerException
Description copied from interface: IProcessContext
Returns the value of the process-level configuration property with the specified name or null if no such property exists.

Specified by:
getProperty in interface IProcessContext
Parameters:
propertyName - The name of the configuration property to return.
Returns:
The value of the process-level configuration property with the specified name or null if no such property exists.
Throws:
java.lang.NullPointerException - If the supplied property name is null.

loadClass

public final java.lang.Class loadClass(java.lang.String className)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.NullPointerException
Description copied from interface: IProcessContext
Loads a class visible to the process.

Specified by:
loadClass in interface IProcessContext
Parameters:
className - The name of the class to load.
Returns:
The requested class instance.
Throws:
java.lang.ClassNotFoundException - If a class with the specified name cannot be found.
java.lang.NullPointerException - If the supplied class name is null.